//
//  TKIMProperty.h
//  XmppTest
//
//  Created by liupm on 15/9/17.
//  Copyright (c) 2015年 liupm. All rights reserved.
//

typedef void(^TKIMCallBack)(TKIMResultVo *resultVo);


#define dispatch_im_main_sync_safe(block)\
if ([NSThread isMainThread]) {\
block();\
} else {\
dispatch_sync(dispatch_get_main_queue(), block);\
}

#define dispatch_im_main_async_safe(block)\
if ([NSThread isMainThread]) {\
block();\
} else {\
dispatch_async(dispatch_get_main_queue(), block);\
}


#define TKIMWS(weakSelf)  __weak __typeof(&*self)weakSelf = self;
#define TKIMTimeFormatter @"yyyy-MM-dd'T'HH:mm:ss.SSSZ"
#define TKIMRoomType [[TKIMSDKConfig shareInstance] getUserType:@"room"]//聊天室
#define TKIMGroupType [[TKIMSDKConfig shareInstance] getUserType:@"group"]//群
#define TKIMDefaultUserType [[TKIMSDKConfig shareInstance] getUserType:@"default"]//好友
#define TKIMOfficialType [[TKIMSDKConfig shareInstance] getUserType:@"off"]//公众号
#define TKIMSysType [[TKIMSDKConfig shareInstance] getUserType:@"sys"]//系统号
#define TKIMHttpToken @"TKIMHttpToken"//HTTP请求会话TOKEN
#define TKIMDefaultChannelType [[TKIMSDKConfig shareInstance].channels[@"chat"] integerValue]//默认的聊天渠道
#define TKIMFloderType [[TKIMSDKConfig shareInstance] getUserType:@"folder"]//文件夹用户类型
#define TKIMError(errorNo,errorInfo)   [NSError errorWithDomain:@"com.thinkive.im.error" code:errorNo userInfo:@{@"userInfo":errorInfo}]

